﻿#region

using System.Text.RegularExpressions;

#endregion


namespace OMS.Ice.T4Generator.Syntax
{
    internal class CommentDirective : Part
    {
        public CommentDirective( Match match )
        {
            Match = match;

            if( match.Groups["comment"].Captures.Count > 0 )
                Content = match.Groups["comment"].Captures[0].Value;
        }

        protected Match Match { get; private set; }

        public override int Index
        {
            get { return Match.Index; }
        }

        public override int Position
        {
            // Position and Index are the same for comments.
            get { return Index; }
        }

        public override int Length
        {
            get { return Match.Length; }
        }

        public string Content { get; private set; }
    }
}